<div id="tel">
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<center>
    <h2>展示页面</h2>
    <form action="sear.php" method="post">
        <input type="text" name="cha">
        <input type="submit" value="搜索">

        <table border="1">
            <tr>
                <td><button>全选</button></td>
                <td>编号</td>
                <td>小说名</td>
                <td>作者</td>
                <td>描述</td>
                <td>编辑</td>
            </tr>
            <?php foreach($data['pageinfo'] as $key=>$v){ ?>
            <tr>
                <td><input type="checkbox"></td>
                <td><?php echo $v['id']?></td>
                <td><?php echo $v['name']?></td>
                <td><?php echo $v['zuo']?></td>
                <td><?php echo $v['mean']?></td>
                <td>
                    <a href="delete.php ? id=<?php echo $v['id']?>">删除</a>|
                    <a href="update.php ? id=<?php echo $v['id']?>">修改</a>|
                    <a href="state.php ? id=<?php echo $v['id']?>">生成静态化</a>
                </td>
            </tr>
            <?php } ?>
            <tr>
                <td></td>
                <td><button><a href="javascript:void(0)" onclick="fun(1)">首页</a></button></td>
                <td><button><a href="javascript:void(0)" onclick="fun(<?php echo $data['pagestr']['prev']?>)">上一页</a></button></td>
                <td><button><a href="javascript:void(0)" onclick="fun(<?php echo $data['pagestr']['next']?>)">下一页</a></button></td>
                <td><button><a href="javascript:void(0)" onclick="fun(<?php echo $data['pagestr']['pagenum']?>)">尾页</a></button></td>
                <td>共 <font color="purple"><?php echo $data['pagestr']['pagenum']?></font>页</td>
            </tr>
        </table>
    </form>
</center>


</body>
</html>
</div>
<script>
    function fun($page) {
        ajax = new XMLHttpRequest();
        ajax.open('get','show.php?page='+$page);
        ajax.send();
        ajax.onreadystatechange = function(){
            if(ajax.readyState==4&&ajax.status==200){
                var str = ajax.responseText;
                document.getElementById('tel').innerHTML=str;
            }
        }
    }
    /*function fun2($cha){
        ajax = new XMLHttpRequest();
        ajax.open('get','sear.php?cha='+$cha);
        ajax.send();
        ajax.onreadystatechange = function(){
            if(ajax.readyState==4&&ajax.status==200){
                var str = ajax.responseText;
                document.getElementById('tel').innerHTML=str;
            }
        }
    }*/








</script>